package com.device.service.impl;

import java.util.List;
import java.util.ArrayList;
import com.device.util.Page;
import com.device.vo.TabDeviceVo;
import javax.annotation.Resource;
import com.device.entity.TabDevice;
import com.device.mapper.TabDeviceMapper;
import com.device.service.TabDeviceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lgb
 * @date 2020-10-15
 * @return 设备impl 
 **/
@Service
public class TabDeviceServiceImpl implements TabDeviceService{

	@Resource
	private TabDeviceMapper tabDeviceMapper;
	
	@Override
	@Transactional(readOnly=true)
	public Page<TabDevice> findPage(TabDeviceVo deviceVo) {
		int total = tabDeviceMapper.findTabDeviceTotal(deviceVo);
		List<TabDevice> list = new ArrayList<TabDevice>();
		if(total > 0) {
			list = tabDeviceMapper.listTabDevice(deviceVo);
		}
		return new Page<TabDevice>(list,deviceVo,total);
	}

}